package com.wkbb.sports.dto;

import java.text.NumberFormat;
import java.util.Date;

import com.wkbb.sports.enums.SportsModelTypeEnum;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class JumpTrainSummaryDto {


	@ApiModelProperty(value ="训练ID" )
	private Long trainId;
	
	@ApiModelProperty(value ="开始时间" )
	private Date startTime;
	
	@ApiModelProperty(value ="截止时间" )
	private Date endTime;

	@ApiModelProperty(value ="班级id" )
	private Long classId;

	@ApiModelProperty(value ="班级名称" )
	private String className;

	@ApiModelProperty(value ="老师id" )
	private Long teacherId;

	@ApiModelProperty(value ="老师" )
	private String teacher;

	@ApiModelProperty(value ="模式" )
	private Byte modelType;

	@ApiModelProperty(value ="状态" )
	private Byte status;
	

	@ApiModelProperty(value ="男生人数" )
	private Integer male;

	@ApiModelProperty(value ="女生人数" )
	private Integer female;

	@ApiModelProperty(value ="平均次数" )
	public String getAvgCount() {
		double res = 0D;
		if(male + female > 0) {
			res = totalCount / (male + female);
		}
		NumberFormat nf = NumberFormat.getNumberInstance();
		nf.setMaximumFractionDigits(1);
		return nf.format(res);
	}

	@ApiModelProperty(value ="中位数" )
	private Double medianCount;

	@ApiModelProperty(value ="最大次数" )
	private Double maxCount;

	@ApiModelProperty(value ="最小次数" )
	private Double minCount;

	@ApiModelProperty(value ="总次数" )
	private Double totalCount;
	

	@ApiModelProperty(value ="男生优秀人数" )
	private Integer maleFine;

	@ApiModelProperty(value ="男生良好人数" )
	private Integer maleGood;

	@ApiModelProperty(value ="男生及格人数" )
	private Integer malePass;

	@ApiModelProperty(value ="男生不及格人数" )
	private Integer maleFail;
	

	@ApiModelProperty(value ="女生优秀人数" )
	private Integer femaleFine;

	@ApiModelProperty(value ="女生良好人数" )
	private Integer femaleGood;

	@ApiModelProperty(value ="女生及格人数" )
	private Integer femalePass;

	@ApiModelProperty(value ="女生不及格人数" )
	private Integer femaleFail;
	
	public String getModelTypeName() {
		try {
			return SportsModelTypeEnum.getDesc(modelType.intValue());
		}catch(Throwable e) {
			return "";
		}
	}
}
